<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue/vue.js" charset="utf-8"></script>

</head>
<body>

<div id="app">

    <input type="text"  v-model="a">
    <br>
    {{aaa | guolv}}
    <br>
    {{b | date}}
    <hr>
    <ul>
        <li v-for="value in arr">{{value}}</li>
    </ul>

</div>

<script>
    //自定义过滤器
    Vue.filter('guolv',function (input) {
        return input<10?'0'+input:''+input

    })
    Vue.filter('date',function (input) {
        var oDate = new Date(input)
        return oDate.getFullYear()+'-'+(oDate.getMonth()+1)+'-'+oDate.getDate()
            +' '+oDate.getHours()+':'+oDate.getMinutes()+':'+oDate.getSeconds()
    })

    new Vue({
        data:{
            arr:['width','height','background','orange'],
            a:'',
            aaa:11,
            b:Date.now()
        },
        show:function () {
            alert(1)
        }
    }).$mount('#app')
</script>

</body>
</html>